package widget;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import pojo.ChessOnlineRoom;
import callback.Callback;

public class RoomWidget extends MyButtonWidget{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String mRoomName;
	private String mHostName;
	
	public RoomWidget(int posX, int posY, String backgroundEnable,
			String backgoundDisable, ChessOnlineRoom room, Callback callback) {
		super(posX, posY, backgroundEnable, backgoundDisable, "", callback);
		
		this.mRoomName = room.getmRoomName();
		this.mHostName = room.getPlayerA().getName();
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		
		g.setFont(new Font("Buxton Sketch", Font.BOLD, 24));
		  g.setColor(Color.magenta);
		  g.drawString(mRoomName, mPosX + 40, mPosY + 30);
		  g.setColor(Color.pink);
		  g.drawString(mHostName, mPosX + 40, mPosY + 55);
	}
}
